home *** CD-ROM | disk | FTP | other *** search
- /* $VER: PB_GetSyntax.ced ENG 1.0 (03-Sep-2000) by A.Greve */
-
- sourcepath = 'PureBasic:Projects'
- cedname = 'CED:Ed'
- temp_s = 'T:pb_srch.txt'
- temp_l = 'T:pb_link.txt'
- fkey1 = 1
-
- /**********************************************************/
-
- cedscript1 = 'PureBasic:Extras/CygnusEd/PB_GetSyntax.ced'
- indexfile = 'PureBasic:Help/IndexAll.guide'
- lf = '0a'x; qu = '22'x
- link = '@{'qu
-
- IF sourcepath == 'SOURCEPATH' THEN sourcepath = 'PureBasic:'
- IF cedname == 'CEDNAME' THEN cedname = 'ed'
- IF temp_s == 'TEMP_S' THEN temp_s = 'T:pb_srch.txt'
- IF temp_l == 'TEMP_L' THEN temp_l = 'T:pb_link.txt'
- IF (fkey1 < 1) | (fkey1 > 10) | (fkey1 == 'FKEY1') THEN fkey1 = 1
-
- OPTIONS RESULTS
-
- IF ADDRESS() = 'REXX' THEN DO
- IF SHOW(p,'CYGNUSED') THEN InstScript()
- ELSE DO
- IF ~SHOW('L','rexxsupport.library') THEN DO
- IF ~ADDLIB('rexxsupport.library',10,-30,0) THEN DO
- SAY 'Couldn''t open <rexxsupport.library> !'
- EXIT(0)
- END
- END
- IF ~SHOW('L','rexxtricks.library') THEN DO
- IF ~ADDLIB('rexxtricks.library',10,-30,0) THEN DO
- SAY 'Couldn''t open <rexxtricks.library> !'
- EXIT(0)
- END
- END
- IF ~SHOW('L','rexxreqtools.library') THEN DO
- IF ~ADDLIB('rexxreqtools.library',10,-30,0) THEN DO
- SAY 'Couldn''t open <rexxreqtools.library> !'
- EXIT(0)
- END
- END
- IF ~SHOW('L','amigaguide.library') THEN DO
- IF ~ADDLIB('amigaguide.library',10,-30,0) THEN DO
- SAY 'Couldn''t open <amigaguide.library> !'
- EXIT(0)
- END
- END
-
- filename = RTFILEREQUEST(sourcepath,,'Please select a PureBasic script...',,,
- 'rtfi_matchpat=#?.pb rtfi_flags=freqf_patgad')
- IF filename ~= '' THEN ADDRESS COMMAND cedname' 'filename
-
- IF READFILE(indexfile, 'index') THEN DO
- j = 0
- DO i = 1 TO index.0
- IF WORD(index.i, 1) = link THEN DO
- j = j + 1
- indsrch.j = WORD(index.i, 2)
- tmp = WORD(index.i, 5)
- indlink.j = LEFT(tmp, LENGTH(tmp) - 1)
- indlink.j = CENTER(indlink.j, LENGTH(indlink.j) - 2)
- END
- END
- DROP index.
- indsrch.0 = j; indlink.0 = j
- IF ~WRITEFILE(temp_s, 'indsrch') THEN DO
- SAY 'Couldn''t create <'temp_s'> !'
- EXIT(0)
- END
- IF ~WRITEFILE(temp_l, 'indlink') THEN DO
- SAY 'Couldn''t create <'temp_l'> !'
- EXIT(0)
- END
- END
- ELSE DO
- SAY 'Couldn''t open <'indexfile'> !'
- EXIT(0)
- END
-
- InstScript()
- EXIT(0)
- END
- END
-
- ADDRESS COMMAND 'Version >NIL: amigaguide.library 40'
- aguidever = RC
-
- IF ~READFILE(temp_s, 'indsrch') THEN DO
- SAY 'Couldn''t open <'temp_s'> !'
- EXIT(0)
- END
- IF ~READFILE(temp_l, 'indlink') THEN DO
- SAY 'Couldn''t open <'temp_l'> !'
- EXIT(0)
- END
-
- CEDTOFRONT
- GETWORD
- theword = RESULT
- IF theword ~= 0 THEN DO
- IF FIND('B L S UB UL UW W', UPPER(theword)) > 0 THEN DO
- LEFT
- GETWORD
- IF RESULT = '.' THEN theword = '.'theword
- RIGHT
- END
- num = RXTR_LSEARCH(theword, 'indsrch', 1)
- IF num > 0 THEN DO
- IF aguidever = 5 THEN
- CALL SHOWNODE('CygnusEdScreen1', RXTR_PATHPART(indlink.num), RXTR_FILEPART(indlink.num),)
- ELSE
- CALL SHOWNODE('CygnusEdScreen1', RXTR_PATHPART(indlink.num), RXTR_FILEPART(indlink.num),,)
- END
- ELSE OKAY1 'Couldn''t get information about'lf'<'theword'> !'
- END
- EXIT(0)
-
- InstScript:
- ADDRESS 'CYGNUSED'
- IF EXISTS(cedscript1) THEN "INSTALL DOS/AREXX COMMAND" fkey1 cedscript1
- ELSE SAY 'Couldn''t find and install <'cedscript1'> !'
- RETURN 0
-
-